<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>六西格玛知识管理</title>
<link href="<?php echo $this->baseUrl ?>/public/style/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/daterangepicker.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/jquery-ui.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $this->baseUrl ?>/public/style/jquery.treeview.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jquery.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/daterangepicker.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jquery-ui.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/scripts/jquery.treeview.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl ?>/public/fckeditor/fckeditor.js"></script>
<script type="text/javascript">
$(function() {
	$("#tree").treeview({
		collapsed: false,
		animated: "medium",
		control: "#sidetreecontrol"
	});
})
</script>
</head>

<body>
<!--头部-->
<?php echo $this->partial('common/header.html', array('template'=>$this->template, 'baseUrl'=>$this->baseUrl)) ?>

<!--主体-->
<div class="main-box" id="mainBox">
    <div class="third-menu">
        <?php echo $this->partial('common/operation.html', array('template'=>$this->template, 'baseUrl'=>$this->baseUrl)) ?>
        <div class="menu-title"><span class="icon"></span>标签树详细信息页</div>
    </div>
        
    <div class="separate-line"></div>
    <div class="main-form" style="margin-bottom:20px;">
        <div class="project-show">
            <h2 class="project-title"><?php echo $this->tree[0]['name']; ?></h2>
            <div class="project-info">
                <span>关键字：<?php echo $this->tree[0]['key_word']; ?></span>
                <span>添加时间：<?php echo date("Y-m-d", $this->tree[0]['create_time']); ?></span>
            </div>
        </div>
    </div>
    <div class="mod-tree">
        <div class="tree-list" style="width:300px;">
            <div class="t"><div class="r"></div></div>
            <div class="m">
            	<div class="container" id="container">
                	<?php
                    function recursion($arr, $bolFirst = true){
                    	echo $bolFirst?"<ul id='tree' style='margin:10px 0 0 15px'>":"<ul>";
                    	foreach($arr as $row){
                        	if(is_array($row[0])){
                            	recursion($row, false);
                                echo "</li>";
                            }else{
                            	echo "<li><a href='?tree_id=".$_GET['tree_id']."&tag_id=".$row['tag_id']."'>".$row['name']."</a>";
                            }
                        }
                        echo "</ul>";
                    }
                    if(!empty($this->tags)){
                    	recursion($this->tags, true);
                    }
                    ?>
                </div>
    		</div>
            <div class="b"><div class="r"></div></div>
        </div>
        <div class="tree-tags" style="width:650px;">
            <div class="t"><div class="r"></div></div>
            <div class="m">
            	<div class="container">
                	<?php if($this->projects): ?>
                        <table width="640px" border="1" bordercolor="#CCCCCC" style="margin-bottom:10px">
                        <tr><th colspan="3" style="font-size:14px; color:#C00">标签相关项目</th></tr>
                        <tr align="center">
                            <th width="40%">项目名称</th>
                            <th width="30%">关键字</th>
                            <th width="30%">项目时间</th>
                        </tr>
                        <?php foreach ($this->projects as $key => $val): ?>
                            <tr align="center">
                                <td>
                                    <a href="<?php echo $this->baseUrl; ?>/project/detail?project_id=<?php echo $val['project_id']; ?>" target="_blank">
                                    <?php echo $val['title']; ?>
                                    </a>
                                </td>
                                <td><?php echo $val['key_word']; ?></td>
                                <td><?php echo date('Y-m-d',$val['start_time']); ?> -- <?php echo date('Y-m-d',$val['end_time']); ?></td>
                            </tr>
                        <?php endforeach; ?>
                        </table>
                    <?php endif; ?>
                <div class="page-bar2">
                <div>总数：<span class="total-count"><?php echo $this->ps_total ?></span></div>
                <div>
                <?php if ($this->ps_page > 1): ?>
                <a href="<?php echo $this->baseUrl ?>/tree/detail?tree_id=<?php echo $_GET['tree_id']; ?>&tag_id=<?php echo $_GET['tag_id'];?>&ps_page=1">首页</a>
                <?php else: ?>
                首页
                <?php endif; ?>
                <?php if ($this->ps_page > 1): ?>
                <a href="<?php echo $this->baseUrl ?>/tree/detail?tree_id=<?php echo $_GET['tree_id']; ?>&tag_id=<?php echo $_GET['tag_id'];?>&ps_page=<?php echo $this->ps_page-1 ?>">上一页</a>
                <?php else: ?>
                上一页
                <?php endif; ?>
                <?php if ($this->ps_page < $this->ps_pages): ?>
                <a href="<?php echo $this->baseUrl ?>/tree/detail?tree_id=<?php echo $_GET['tree_id']; ?>&tag_id=<?php echo $_GET['tag_id'];?>&ps_page=<?php echo $this->ps_page+1 ?>">下一页</a>
                <?php else: ?>
                下一页
                <?php endif; ?>
                <?php if ($this->ps_page < $this->ps_pages): ?>
                <a href="<?php echo $this->baseUrl ?>/tree/detail?tree_id=<?php echo $_GET['tree_id']; ?>&tag_id=<?php echo $_GET['tag_id'];?>&ps_page=<?php echo $this->ps_pages ?>">尾页</a>
                <?php else: ?>
                尾页
                <?php endif; ?>
                </div>
                <div>页数：<span class="page-detail"><?php echo $this->ps_page ?>/<?php echo $this->ps_pages ?></span></div>
          	</div>
                    <?php if($this->students): ?>
                        <table width="640px" border="1" bordercolor="#CCCCCC">
                        <tr><th colspan="3" style="font-size:14px; color:#C00">标签相关学生</th></tr>
                        <tr align="center">
                            <th width="40%">学生姓名</th>
                            <th width="30%">出生日期</th>
                            <th width="30%">学生职务</th>
                        </tr>
                        <?php foreach ($this->students as $key => $val): ?>
                            <tr align="center">
                                <td>
                                    <a href="<?php echo $this->baseUrl; ?>/student/detail?student_id=<?php echo $val['student_id']; ?>" target="_blank">
                                    <?php echo $val['name']; ?>
                                    </a>
                                </td>
                                <td><?php echo date('Y-m-d',$val['birthday']); ?></td>
                                <td>
                                    <?php echo $val['duties']; ?>  
                                </td>
                            </tr>
                        <?php endforeach; ?>
                        </table>
                    <?php endif; ?>
                
                </div>
            </div>
            <div class="b"><div class="r"></div></div>
        </div>        
    </div>
</div>
<!--底部-->
<?php echo $this->partial('common/footer.html') ?>
</body>
</html>
